Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/6.0] Query: Don't add DbParameter if already added #28348

Merged
merged 1 commit into from
Jul 6, 2022

Conversation

smitpatel
Copy link
Contributor

Resolves #27427

If a FromSql with DbParameter is reused in multiple parts of query then we need to add the DbParameter only once

Description

If same FromSql with DbParameter is reused in multiple parts of a query then we try to add DbParameter twice which throws an error.

Customer impact

Customers reusing FromSql will see an error. In case of GroupBy aggregate even if customer didn't write query in reusable way, it can still cause an error because we internally create copy.

How found

Customer reported on 6.0.2

Regression

Partially. In the scenario, where customer is reusing the query it threw error always. In case of groupby aggregate it is regression caused by us when we stopped lifting the aggregate element in all cases.

Testing

Added tests for affected scenario.

Risk

Low. Also added quirk to revert back to older behavior.

Resolves #27427

If a FromSql with DbParameter is reused in multiple parts of query then we need to add the DbParameter only once
@rbhanda rbhanda added this to the 6.0.8 milestone Jul 5, 2022
@dougbu dougbu merged commit 4912805 into release/6.0 Jul 6, 2022
@dougbu dougbu deleted the smit/issue27427 branch July 6, 2022 00:57
@ajcvickers ajcvickers removed this from the 6.0.8 milestone Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants